<%--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false" session="true"%>--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="reportTitle" value="扩散报表" />

<%@ include file="/common/report_head.jsp" %>
<%@ include file="/condition/sartTime_input.html"%>
<%@ include file="/condition/endTime_input.html"%>
<%@ include file="/condition/fab_sumo_must.html"%>
<%@ include file="/condition/line_sumo.html"%>
<%@ include file="/condition/ope_sumo.html"%>
<%@ include file="/condition/tool_main_sumo.html"%>
<%@ include file="/condition/tool_sub_sumo.html"%>

<%@ include file="/common/report_middle.jsp" %>
<%@ include file="/charts-grid/echarts2.html"%>
<div class="col-md-12" style="height: 420px;margin-bottom: 25px;">
    <div id="pqGrid"></div>
</div>
<%@include file="/common/report_end.jsp" %>


<script>
    $(document).ready(function () {
        $("title").text("扩散报表");

        $('#query_btn').click(function (){
            initGridAndChart();
            ajax('/jn-report/report/kuosan_report.do' ,loadConditionMapData(), true, ajax_successful);

            function ajax_successful(outTrxObj) {
                if(outTrxObj.gridData.length < 1) { showMessengerDialog("数据查询为空"); return false; }

                //Chart图数据赋值
                var $charts = $("#charts");
                var echartsData = outTrxObj.chartsData;
                if ($charts.length > 0) {
                    //option.title.yAxis[0].name = echartsData.yAxisName;
                    option.title.text = echartsData.title;
                    option.title.subtext = echartsData.subTitle;
                    option.title.subtextStyle = {
                        color : "black",
                        fontFamily : 'Arial, Verdana, sans...',
                        fontSize : 12,
                        fontStyle : 'normal',
                        fontWeight : 'normal'
                    }
                    option.legend.data = [];
                    option.legend.data = echartsData.legendData;
                    option.xAxis[0].data = [];
                    option.xAxis[0].data = echartsData.xAxisData;
                    option.series = [];
                    for (var i = 0; i < echartsData.seriesDatas.length; i++) {
                        option.series.push({
                            name: echartsData.legendData[i],
                            type: 'line',
                            data: echartsData.seriesDatas[i],
                            itemStyle : {
                                normal : {
                                    lineStyle:{
                                        color : '#000079'
                                    }
                                }
                            },
                            label: {normal: {show: true, color: '#4F4F4F'}}
                        });
                    }
                    myChart.clear();
                    myChart.setOption(option);
                }

                //grid表格数据
                var colM = [
                    {halign:"center",align:'center', dataIndx: 'tool_id_fk',    	 title: '设备代码',     width: 150,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'tube_id_fk',      	 title: '管号',         width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'boat_id_fk',    	 title: '舟号',         width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'start_timestamp',title: '上报开始时间', width: 220,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'end_timestamp',  title: '上报结束时间', width: 220,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_1',  	 title: '上报值1',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_2',  	 title: '上报值2',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_3',  	 title: '上报值3',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_4',  	 title: '上报值4',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_5',  	 title: '上报值5',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_6',  	 title: '上报值6',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_7',  	 title: '上报值7',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_8',  	 title: '上报值8',      width: 85,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_value_avg',  	 title: '平均值值',     width: 85,    editable: false, sortable: true}
                ];
                _pqUtil.f.setColModel($("#pqGrid"), colM);
                _pqUtil.f.seTitle($("#pqGrid"), outTrxObj.gridTitle);
                _pqUtil.f.loadPqGridData($("#pqGrid"), outTrxObj.gridData);
            };
        });

    });
</script>
